import React, { Component } from 'react'
import bus from '../util/eventbus'
export default class Right extends Component {
  getBrotherData=(msg)=>{
    console.log('Right组件接受一方的函数:',msg);
  }
  componentDidMount(){
    //在该生命周期方法中完成监听
    bus.addListener('e1',this.getBrotherData)
  }
  render() {
    return (
        <div style={{flexGrow:1,backgroundColor:'pink',height:'100vh'}}>
            <h1>Right组件</h1>
            <div></div>
        </div>
    )
  }
}
